<!--
 * @Description: 
 * @Author: mmzhang
 * @Date: 2022-07-14 14:35:05
 * @LastEditTime: 2022-09-14 16:47:51
-->
<template>
  <dt-modal-info ref="info" title="签约单调整明细" :width="1000">
    <dt-info ref="options" :options="options" :info="info"></dt-info>
    <dt-grid ref="table" :columns="columns" :list="adjustList" :height="300"></dt-grid>
  </dt-modal-info>
</template>
<script>
  import conDetailOpt from './conDetail'
  export default {
    props: ['detailMsg'],
    data() {
      return {
        options: [],
        columns: [],
        info: {},
        adjustList: []
      }
    },
    mounted() {
      this.adjustList = this.detailMsg.orAdjustmentDetailVOList.map(item => {
        item.areaDV = item.afterAdjustArea != '-' ? (item.afterAdjustArea - item
          .currentAdjustArea).toFixed(2) : '0.00'
        item.priceDV = item.afterAdjustPrice != '-' ? (item.afterAdjustPrice - item
          .currentAdjustPrice).toFixed(
          2) : '0.00'
        return item
      })

      this.info = {
        initialTotalPrice: this.detailMsg.orContractWebInfoVO.initialTotalPrice,
        totalPrice: this.detailMsg.orContractWebInfoVO.totalPrice,
        priceDV: (this.detailMsg
          .orContractWebInfoVO.totalPrice - this.detailMsg.orContractWebInfoVO
          .initialTotalPrice).toFixed(2),
        area: this.detailMsg.orRoomDetailsVO.area,
        initialArea: this.detailMsg.orRoomDetailsVO.initialArea,
        areaDV: (this.detailMsg
          .orRoomDetailsVO.area - this.detailMsg.orRoomDetailsVO.initialArea).toFixed(2),
      }
    },
    methods: {
      show() {
        this.options = new conDetailOpt(this).options().options
        this.columns = new conDetailOpt(this).options().columns
        this.$refs.info.show()
        this.$nextTick(function() {
          this.$refs.table.init(this)
          this.$refs.table.loadList(this.adjustList)
        })
      }
    }
  }
</script>